package com.syni.mdd.yhd.common.all.controller.protect.business;

/**
 * @className BmsBusinessController
 * @description TOO
 * @Author cfx
 * @DATE 2019/4/15 14:25
 * @VERSION 1.0
 **/

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckParams;
import com.syni.mdd.yhd.common.all.service.BmsBusinessComplainService;
import com.syni.mdd.yhd.common.all.service.BmsBusinessFlowService;
import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/businessFlow")
public class BmsBusinessFlowController {
    @Autowired
    BmsBusinessFlowService bmsBusinessFlowService;

    @Autowired
    BmsBusinessComplainService bmsBusinessComplainService;


    @PostMapping("/getToken")
    @CheckParams(checkAuth = true)
    public Map<String,Object> getToken(@RequestBody ParamsMap paramsMap){
        return bmsBusinessFlowService.getToken(paramsMap);
    }


    @PostMapping("/save")
    @CheckParams(checkAuth = true,params = {"flowId","flowStatus"})
    public Map<String,Object> save(@RequestBody ParamsMap paramsMap){
        return bmsBusinessFlowService.save(paramsMap);
    }

}
